%form#options_main{:action=>"#", :method=>"post"}
  #tabs
    %ul
      - @opts.each do |k,sect|  
        %li 
          %a{:href=>"#tab_#{k}"} 
            %span
              =k.humanize
    - @opts.each do |k,sect|  
      %div{:id=>"tab_#{k}"}          
        - sect.each do |o|
          %div
            %label{:for=>"#{k}_#{o[0]}"}            
              %input{:id=>"#{k}_#{o[0]}", :name=>"#{k}[#{o[0]}]",:type => "field" , :value=> o[1] }
              = o[0].humanize
.push-24.last
  .span-9
    %hr/
  .push-15.last
  .span-8{ :align=>"center" }
    %a.button#formoptssubmit{:href=>"#"} Save
  .push-16.last"
  :javascript
    $("#tabs").tabs();
    $("#formoptssubmit").click(function(){
      $.ajax({
        type: "POST",
        url: "/options",
        data: $("#options_main").serialize(),
        success: function(html){
          alert(html);
        }
      });
    });